import axios from '@/libs/request/axios'
import QS from 'qs';

// 查询豁免单列表数据

export const page = (params) => {
    return axios.request({
        url: `/contractManage/exemptSingleBill/findCostExemptBillList`,
        method: 'POST',
        data: params
    })
};

export const getBasicCostList = (params) => {
    return axios.request({
        url: `/contractBasic/basicCostExemptBillInfo/getBasicCostList`,
        method: 'POST',
        data: params
    })
};

export const getBasicCostLoanList = (params) => {
    return axios.request({
        url: `/contractBasic/basicCostExemptBillInfo/getBasicCostLoanList`,
        method: 'POST',
        data: params
    })
};
//查询罚息总额
export const findByContractNoBasicExpenseRecord = (contractNo) => {
    return axios.request({
        url: `/contractBasic/basicCostExemptBillInfo/findByContractNoBasicExpenseRecord`,
        data: QS.stringify({contractNo:contractNo},{arrayFormat: 'repeat'}),
        method: 'POST',
        headers: { 'content-type': 'application/x-www-form-urlencoded' },

    })
};

//查询费用总额
export const findByContractNobasicExpense = (contractNo) => {
    return axios.request({
        url: `/contractBasic/basicCostExemptBillInfo/findByContractNobasicExpense`,
        data: QS.stringify({contractNo:contractNo},{arrayFormat: 'repeat'}),
        method: 'POST',
        headers: { 'content-type': 'application/x-www-form-urlencoded' },

    })
};
//通过ID来删除费用豁免单
export const delById = (id,params) => {
    return axios.request({
        url: `/contractManage/exemptSingleBill/delById/${id}`,
        method: 'delete',
        data: params
    })
};
//保存费用豁免单信息
export const submit = (params) => {
    return axios.request({
        url: `/contractManage/exemptSingleBill/addCostExemptBill`,
        method: 'post',
        data: params
    })
};

//保存费用豁免单审批信息
export const saveProposalApplicationInfo = (params) => {
    return axios.request({
        url: `/contractManage/exemptSingleBill/saveProposalApplicationInfo`,
        method: 'post',
        data: params
    })
};


//提交费用豁免单审批信息
export const submitCostExemptBill = (params) => {
    return axios.request({
        url: `/contractManage/exemptSingleBill/submitCostExemptBill`,
        method: 'post',
        data: params
    })
};
